Cleaning system and method for cleaning work area of machine tool

ABSTRACT

A cleaning system capable of improving efficiency of a cleaning operation onto a work area of a machine tool. The cleaning system includes a cleaning nozzle attached to and detached from an attachment device provided in the machine tool, and configured to inject fluid; a robot configured to grip the cleaning nozzle; and a cleaning execution section configured to execute a detaching operation to operate the robot so as to grip the cleaning nozzle attached to the attachment device and detach the cleaning nozzle from the attachment device, and a cleaning operation to move the cleaning nozzle with respect to the work area by the robot, and inject the fluid from the cleaning nozzle to clean the work area.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a cleaning system and method forcleaning a work area of a machine tool.

2. Description of the Related Art

A system of cleaning a work area of a machine tool has been known (e.g.,JP 10-118884 A). In prior art, there has been a need for improvingefficiency for cleaning operation by a cleaning system of a machinetool.

SUMMARY OF THE INVENTION

In an aspect of the present disclosure, a cleaning system configured toclean a work area of a machine tool, includes a cleaning nozzle attachedto and detached from an attachment device provided in the machine tool,and configured to inject fluid; a robot configured to grip the cleaningnozzle; and a cleaning execution section configured to execute adetaching operation to operate the robot so as to grip the cleaningnozzle attached to the attachment device and detach the cleaning nozzlefrom the attachment device, and a cleaning operation to move thecleaning nozzle with respect to the work area by the robot, and injectthe fluid from the cleaning nozzle to clean the work area.

In another aspect of the present disclosure, a method of cleaning a workarea of a machine tool, including executing a detaching operation tooperate a robot so as to grip a cleaning nozzle attached to anattachment device provided in the machine tool and detach the cleaningnozzle from the attachment device; and a cleaning operation to move thecleaning nozzle with respect to the work area by the robot, and injectfluid from the cleaning nozzle to clean the work area.

According to the present disclosure, since the cleaning nozzle can beoperated by the robot to perform cleaning of the work area of themachine tool, it is possible to improve the efficiency of the cleaningoperation.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a cleaning system according to anembodiment.

FIG. 2 is a schematic view of the cleaning system illustrated in FIG. 1.

FIG. 3 is a flowchart illustrating an example of an operation process ofthe cleaning system illustrated in FIG. 1.

FIG. 4 illustrates an example depicting first image data captured instep S1 in FIG. 3.

FIG. 5 illustrates an example depicting second image data captured instep S3 in FIG. 3.

FIG. 6 is a diagram schematically illustrating an example of quantifyingbrightness of each pixel of the first image data.

FIG. 7 is a diagram schematically illustrating an example of quantifyingbrightness of each pixel of the second image data.

FIG. 8 is a diagram in which brightness of each pixel of third imagedata according to an example is quantified.

FIG. 9 is a diagram in which brightness of each pixel of third imagedata according to another example is quantified.

FIG. 10 is a diagram in which brightness of each pixel of third imagedata according to yet another example is quantified.

FIG. 11 illustrates an example depicting a histogram of the third imagedata.

FIG. 12 is a block diagram of a cleaning system according to anotherembodiment.

FIG. 13 is a schematic view of the cleaning system illustrated in FIG.12.

FIG. 14 is an enlarged view of an attachment device illustrated in FIG.13.

FIG. 15 illustrates a state in which the attachment device illustratedin FIG. 13 grips a cleaning nozzle.

FIG. 16 is a flowchart illustrating an example of an operation processof the cleaning system illustrated in FIG. 12.

FIG. 17 illustrates an example depicting first image data captured instep S11 in FIG. 16.

FIG. 18 illustrates an example depicting second image data captured instep S15 in FIG. 16.

FIG. 19 is a block diagram illustrating another example of a function ofthe cleaning system illustrated in FIG. 12.

FIG. 20 is a flowchart illustrating an example of an operation processof the cleaning system illustrated in FIG. 19.

FIG. 21 is a flowchart illustrating an example of the process of stepS31 in FIG. 20.

FIG. 22 is a flowchart illustrating an example of the process of stepS32 of FIG. 20.

FIG. 23 is a flowchart illustrating an example of the process of stepS33 in FIG. 20.

FIG. 24 is a schematic view of a cleaning system according to stillanother embodiment.

DETAILED DESCRIPTION

Hereinafter, embodiments of the present disclosure will be described indetail with reference to the drawings. In the various embodiments to bedescribed below, similar elements are denoted by the same referencenumeral, and redundant description thereof will be omitted. First, acleaning system 10 according to an embodiment will be described withreference to FIG. 1 and FIG. 2. The cleaning system 10 is configured toclean a work area 62 of a machine tool 50.

As illustrated in FIG. 2, the machine tool 50 includes a splash guard54, a machining head 56, a telescopic cover 58, and a machining table60. The splash guard 54 is a hollow member defining an interior space A,and prevents foreign matter such as cutting fluid or chips generated inthe interior space A from leaking to the outside. The splash guard 54includes a bottom wall 54 a and a side wall 54 b extending upward fromthe bottom wall 54 a. An opening 54 c is formed in the side wall 54 b.The opening 54 c is opened and closed as necessary by an automatic door(not illustrated).

The machining head 56 is installed in the interior space A, and a tool64 is attached to a tip of the machining head 56. The machining head 56rotates the tool 64 to machine a workpiece. The telescopic cover 58 is atelescopic hollow member, and provided on the bottom wall 54 a of thesplash guard 54. The telescopic cover 58 prevents a component of themachine tool 50 from being exposed to the foreign matter. The machiningtable 60 is provided so as to be movable in a horizontal direction inthe interior space A, and disposed upward of the telescopic cover 58. Ajig (not illustrated) is detachably mounted on the machining table 60,and the workpiece is removably set to the jig.

In the present embodiment, the work area 62 of the machine tool 50 is anarea to be influenced by an operation for the workpiece (e.g., due toadhesion of the foreign matter) in the interior space A, and defined asan area including the splash guard 54 (bottom wall 54 a), the telescopiccover 58, and the machining table 60 (jig), for example.

As illustrated in FIG. 1, the cleaning system 10 includes a controldevice 12, an imaging device 14, a cleaning nozzle 16, and a fluidsupply device 18. The control device 12 controls operations of theimaging device 14 and the fluid supply device 18. Specifically, thecontrol device 12 is a computer including e.g. a processor 20 (CPU, GPU,etc.) and a memory 22 (ROM, RAM, etc.). The processor 20 is communicablyconnected to the memory 22 via a bus 24, and performs calculations forexecuting various functions to be described below, while communicatingwith the memory 22.

Note that the control device 12 may be configured to control a machiningoperation by the machine tool 50 by controlling operations of themachining head 56 and the machining table. Alternatively, a secondcontrol device (not illustrated) different from the control device 12may be provided to control the machining operation by the machine tool50. In this case, the control device 12 may be communicably connected tothe second control device. The memory 22 temporarily or permanentlystores various data.

The imaging device 14 images the work area 62 of the machine tool 50. Asan example, the imaging device 14 is a camera including e.g. an imagesensor such as a CCD or CMOS, an optical lens such as a focus lens, andan image processing processor. As another example, the imaging device 14may be a laser scanner type imaging device including e.g. a laseremitting section configured to emit laser beam, a light receivingsection configured to receive the laser light reflected by an object,and an image generation section configured to generate image data fromthe laser light received by the light receiving section.

As yet another example, the imaging device 14 may be a three-dimensionalvision sensor capable of imaging an object and measuring a distance tothe object. Note that the imaging device 14 may be fixed in the interiorspace A of the machine tool 50, or may be installed outside the splashguard 54 if a part of the wall of the splash guard 54 of the machinetool 50 is open (or is made of a transparent material). Alternatively,the imaging device 14 may be moved to any position and orientation by arobot to be described below. The imaging device 14 images the work area62 of the machine tool 50 in accordance with a command from the controldevice 12, and transmits the captured image data to the control device12.

The cleaning nozzle 16 is hollow and has an injection port 16 a at itstip. The cleaning nozzle 16 injects fluid supplied therein from theinjection port 16 a in a predetermined injection direction. Note thatthe cleaning nozzle 16 may be fixed in the interior space A. In thiscase, the cleaning nozzle 16 is positioned such that the injectiondirection thereof is directed to the work area 62 (e.g., the machiningtable 60) to be cleaned. Alternatively, the cleaning nozzle 16 may bemoved to any position and orientation by the robot to be describedbelow.

The fluid supply device 18 supplies fluid to the cleaning nozzle 16 inaccordance with a command from the control device 12. Specifically, thefluid supply device 18 is fluidically coupled to the cleaning nozzle 16via a fluid supply tube 26 (e.g., a flexible hose), and supplies thefluid (e.g., compressed gas or compressed liquid) inside the cleaningnozzle 16 through the fluid supply tube 26. The cleaning nozzle 16cleans the work area 62 by injecting the fluid supplied from the fluidsupply tube 26 to the work area 62 (e.g., the machining table 60).

Next, an operation of the cleaning system 10 will be described withreference to FIG. 3. A flow illustrated in FIG. 3 is started when theprocessor 20 receives a work-start command from an operator, a hostcontroller, or a computer program. At the start of the flow illustratedin FIG. 3, assume that a workpiece is not set on the machining table 60,and the work area 62 of the machine tool 50 is substantially free of theforeign matter.

In step S1, the processor 20 images the work area 62 by the imagingdevice 14. In this embodiment, the processor 20 performs a simulationmachining process before imaging the work area 62. Specifically, anoperator (or a robot for loading a workpiece) sets the jig on a topsurface 60 a of the machining table 60, and then sets a dummy workpieceto the jig. The dummy workpiece has the same dimension as a workpieceafter machining in step S2 to be described below.

Then, the processor 20 (or the second control device) operates themachining head 56 and the machining table 60 in accordance with amachining program. The machining program includes a command foroperating the machining head 56 and the machining table 60, and acommand for injecting machining fluid (cutting fluid, coolant, etc.)from a machining fluid injection device (not illustrated), andpre-stored in the memory 22.

By executing the machining program, the processor 20 causes themachining head 56 and the machining table 60 to perform the sameoperations as the step S2 to be described below, and causes themachining fluid injection device to inject the machining fluid at thesame timing and flow rate as step S2 to be described below. When themachining program is ended, the machining head 56 and the machiningtable 60 return to their initial positions.

Then, the processor 20 causes the imaging device 14 to image the workarea 62 at a time t₂ at which a predetermined time τ elapses from a timepoint t₁ when the machining fluid has been injected from the machiningfluid injection device last time (i.e., t₂=t₁+τ). Here, the time τ maybe set such that the time t₂ is a time after the processor 20 ends themachining program in the simulation machining process.

For example, the imaging device 14 images the top surface 60 a of themachining table 60 in the work area 62. Alternatively, the imagingdevice 14 may image an inner surface of the bottom wall 54 a of thesplash guard 54, a top surface 58 a of the telescopic cover 58, and thetop surface 60 a of the machining table 60 in the work area 62.

The imaging device 14 transmits captured image data ID₁ (first imagedata) to the processor 20, and the processor 20 stores the image dataID₁ in the memory 22. This image data ID₁ is image data of the work area62 (e.g., the top surface 60 a) imaged by the imaging device 14 beforethe workpiece is machined in the subsequent step S2. FIG. 4 illustratesan example of the image data ID₁ obtained when the imaging device 14images the top surface 60 a of the machining table 60.

In step S2, the machine tool 50 machines the workpiece in the work area62. Specifically, the operator (or the robot for loading a workpiece)attaches the tool 64 to the machining head 56, sets the jig on the topsurface 60 a of the machining table 60, and then sets the workpiece tothe jig.

Then, the processor 20 (or the second control device) operates themachining head 56 and the machining table 60 in accordance with theabove-described machining program so as to machine the workpiece by thetool 64, while injecting the machining fluid from the machining fluidinjection device. As a result, foreign matters such as chips aredeposited in the work area 62 of the machine tool 50. When the machiningprogram ends in this step S2, the machining head 56 and the machiningtable 60 return to the same initial position as at the end of thesimulation machining process described above.

In step S3, the processor 20 controls the imaging device 14 to image thework area 62. Specifically, the processor 20 executes this step S3 atthe time t₂ when the predetermined time τ elapses from the time point t₁at which the machining fluid has been injected from the machining fluidinjection device last time at step S2, and causes the imaging device 14to image the work area 62. For example, the imaging device 14 images thetop surface 60 a of the machining table 60 along the same visual linedirection as in step S1. The imaging device 14 transmits captured imagedata ID₂ (second image data) of the work area 62 to the processor 20,and the processor 20 stores the image data ID₂ in the memory 22.

This image data ID₂ is image data of the work area 62 (e.g., the topsurface 60 a) imaged by the imaging device 14 after the workpiece ismachined in step S2. FIG. 5 illustrates an example of the image data ID₂obtained when the imaging device 14 images the top surface 60 a. Theimage data ID₂ imaged after machining contains foreign matters B such aschips on the top surface 60 a.

In step S4, the processor 20 generates image data ID₃ (third image data)indicating a degree of change in brightness between the image data ID₁imaged in step S1 and the image data ID₂ imaged in the most-recent stepS3. This image data ID₃ is an image having the number of pixels N_(T)the same as the image data ID₁ and the image data ID₂. A method ofgenerating the image data ID₃ will be described below with reference toFIG. 6 to FIG. 10.

FIG. 6 is a diagram schematically illustrating an example of quantifyingbrightness of each pixel of the image data ID₁ imaged before machining,while FIG. 7 is a diagram schematically illustrating an example ofquantifying brightness of each pixel of the image data ID₂ imaged aftermachining. Note that, in FIG. 6 and FIG. 7, five rows and five columnsof pixels are illustrated among whole pixels of the image data ID₁ andthe image data ID₂, for the sake of easy understanding.

The processor 20 generates the image data ID₃ based on the image dataID₁ and the image data ID₂. Brightness BR₃ of each pixel of the imagedata ID₃ is calculated by the following method as a value correspondingto a degree of change between brightness BR₁ of a pixel of the imagedata ID₁ and brightness BR₂ of a pixel of the image data ID₂ whichcorresponds to the pixel of the image data ID₁.

As an example, the processor 20 calculates the brightness BR₃ of eachpixel of the image data ID₃ from Equation (1) of BR₃=BR₁−BR₂. FIG. 8illustrates a schematic diagram in which the brightness BR₃ of eachpixel of the image data ID₃ is quantified when the brightness BR₃ iscalculated from Equation (1).

For example, regarding the brightness BR₃ of the pixel at the y_(n)-throw and the x_(n)-th column of the image data ID₃, since the brightnessBR₁ of the pixel at the y_(n)-th row and the x_(n)-th column of theimage data ID₁ is 100 (FIG. 6), and the brightness BR₂ of the pixel atthe y_(n)-th row and the x_(n)-th column of the image data ID₂ is 100the same as the brightness BR₁ (FIG. 7), BR₃=BR₂−BR₁=0 is satisfied fromEquation (1). That is, if there is no change in brightness between thecorresponding pixels of the image data ID₁ before machining and theimage data ID₂ after machining when the Equation (1) is employed, everybrightness BR₃ of the corresponding pixel of the image data ID₃ becomeszero.

On the other hand, regarding the pixel at the y_(n+2)-th row and thex_(n+4)-th column of the image data ID₃, the brightness BR₁ of the pixelat the y_(n+2)-th row and the x_(n+4)-th column of the image data ID₁ is1 (FIG. 6), while the brightness BR₂ of the pixel at the y_(n+2)-th rowand the x_(n+4)-th column of the image data ID₂ is 255 (FIG. 7)different from the brightness BR₁. Such a change between the brightnessBR₁ and the brightness BR₂ may occur due to the foreign matters Billustrated in FIG. 5. In this case, the brightness BR₃ of the pixel atthe y_(n+2)-th row and the x_(n+4)-th column of the image data ID₃satisfies BR₃=BR₂−BR₁=254 from Equation (1).

As described above, in Equation (1), the brightness BR₃ of each pixel ofthe image data ID₃ is calculated as a difference between the brightnessBR₁ and the brightness BR₂, and as illustrated in FIG. 8, the brightnessBR₃ of the pixel is zero when there is no change in brightness betweenthe pixels of the image data ID₁ and the image data ID₂, while thebrightness BR₃ of the pixel is a value other than zero when there is achange in brightness between the pixels of the image data ID₁ and theimage data ID₂. Note that, in FIG. 8, the pixels having the brightnessBR₃ other than zero are highlighted, for the sake of easy understanding.

As another example, the processor 20 calculates the brightness BR₃ ofeach pixel of the image data ID₃ from Equation (2) ofBR₃=(BR₁−BR₂)/2+128. FIG. 9 illustrates a schematic diagram in which thebrightness of each pixel of the image data ID₃ is quantified when thebrightness BR₃ of each pixel of the image data ID₃ is calculated fromEquation (2).

For example, regarding the pixel at the y_(n)-th row and the x_(n)-thcolumn, the brightness BR₁ of the image data ID₁ is 100, the brightnessBR₂ of the image data ID₂ is 100, and therefore BR₃=(BR₁−BR₂)/2+128=128is obtained from Equation (2). In other words, if there is no change inbrightness between the corresponding pixels of the image data ID₁ beforemachining and the image data ID₂ after machining when this Equation (2)is used, every brightness BR₃ of the corresponding pixel of the imagedata ID₃ becomes 128.

On the other hand, regarding the pixel at the y_(n+2)-th row and thex_(n+4)-th column, the brightness BR₁ of the image data ID₁ is 1,whereas the brightness BR₂ of the image data ID₂ is 255, and therefore,BR₃=(BR₁−BR₂)/2+128=255 is obtained. Thus, in Equation (2), thebrightness BR₃ of each pixel of the image data ID₃ is calculated basedon a difference between the brightness BR₁ and the brightness BR₂, andas illustrated in FIG. 9, the brightness BR₃ is 128 if there is nochange in brightness between the pixels of the image data ID₁ and theimage data ID₂, while the brightness BR₃ is a value other than 128 ifthere is a change in brightness between the pixels of the image data ID₁and the image data ID₂.

As yet another example, the processor 20 calculates the brightness BR₃of each pixel of the image data ID₃ from Equation (3) ofBR₃=(BR₂+1)/(BR₁+1). FIG. 10 illustrates a schematic diagram in whichthe brightness of each pixel of the image data ID₃ is quantified whenthe brightness BR₃ of each pixel of the image data ID₃ is calculatedfrom Equation (3).

For example, regarding the pixel at the y_(n)-th row and the x_(n)-thcolumn, the brightness BR₁ of the image data ID₁ is 100, the brightnessBR₂ of the image data ID₂ is 100, and therefore, BR₃=(BR₂+1)/(BR₁+1)=1is obtained from Equation (3). In other words, if there is no change inbrightness between the corresponding pixels of the image data ID₁ beforemachining and the image data ID₂ after machining when this Equation (3)is used, every brightness BR₃ of the corresponding pixel of the imagedata ID₃ is 1.

On the other hand, regarding the pixel at the y_(n+2)-th row and thex_(n+4)-th column, the brightness BR₁ of the image data ID₁ is 1,whereas the brightness BR₂ of the image data ID₂ is 255, and thereforeBR₃=(BR₂+1)/(BR₁+1)=128 is obtained. Thus, in Equation (3), thebrightness BR₃ of each pixel of the image data ID₃ is calculated basedon a ratio ((BR₂+1)/(BR₁+1)) between the brightness BR₁ and thebrightness BR₂, and as illustrated in FIG. 10, the brightness BR₃ is 1if there is no change in brightness between the pixels of the image dataID₁ and the image data ID₂, whereas the brightness BR₃ is a value otherthan 1 if there is a change in brightness between the pixels of theimage data ID₁ and the image data ID₂.

By means of the above described method, the processor 20 generates theimage data ID₃ indicating the degree of change between the brightnessBR₁ of the image data ID₁ and the brightness BR₂ of the image data ID₂.Accordingly, the processor 20 functions as an image data generationsection 28 (FIG. 1). The processor 20 stores the generated image dataID₃ in the memory 22.

Note that, in FIG. 8 to FIG. 10, for the sake of easy understanding, theimage data ID₃ is shown as grid data of y columns×x rows. However, theimage data ID₃ generated by the processor 20 is not necessarily be suchgrid data, but it may be data in which the pixels and the correspondingbrightness BR₃ are stored in the form of a list, for example.

Again, with reference to FIG. 3, in step S5, the processor 20 acquires ahistogram HG of the image data ID₃ generated in step S4. The histogramHG is data indicating a relationship between the brightness BR₃ of eachpixel of the image data ID₃ and the number of pixels N. An example of adiagram depicting the histogram HG is illustrated in FIG. 11. Note thatthe processor 20 may acquire the histogram HG in the form of onlynumerical data, or may generate an image of the histogram HG asillustrated in FIG. 11 and display the image on a display (notillustrated) provided on the control device 12.

In general, brightness of each pixel in image data is displayed by atotal of 256 stages of 0 to 255. When an image of the histogram HGobtained by above Equation (2) is generated, the brightness BR₃ can berepresented by the 256 stages, and a position of the brightness BR₃=128can be a median of brightness. Thus, according to Equation (2), theimage of the histogram HG can be displayed by an existing imageprocessing program.

Further, if Equation (3) described above is used and the brightness ofthe pixels is displayed by the total of 256 stages of 0 to 255, it ispossible to prevent the brightness BR₁ from being infinity even whenBR₁=0 is satisfied. Note that, if the brightness of the pixels isdisplayed by the total of 256 stages of 1 to 256, Equation (3) may bedefined as an equation of BR₃=BR₂/BR₁.

Regarding the histogram HG, if there is no change in brightness betweenthe corresponding pixels of the image data ID₁ before machining and theimage data ID₂ after machining (i.e., if there is no foreign matter Billustrated in FIG. 5), the number of pixels N where the brightness BR₃is a reference value α₀ is substantially the same as a total number ofpixels N_(T) of the image data ID₃ (i.e., the histogram HG becomes acharacteristics in which an impulse of N≈N_(T) exists at BR₃=α₀), in thehistogram HG. The reference value α₀ is zero when Equation (1) is used,the reference value α₀ is 128 when Equation (2) is used, and thereference value α₀ is 1 when Equation (3) is used.

On the other hand, if there is a change in brightness between thecorresponding pixels of the image data ID₁ before machining and theimage data ID₂ after machining (i.e., if the foreign matters Billustrated in FIG. 5 exist), the number of pixels N exists in a rangeof the brightness BR₃ other than the reference value α₀, in thehistogram HG. Thus, the histogram HG is data statistically indicatingthe change in brightness between the image data ID₁ before machining andthe image data ID₂ after machining.

In step S6, the processor 20 determines whether or not to clean the workarea 62 based on the histogram HG. As an example, the processor 20determines that it is necessary to clean the work area 62 when a rate R₁of the number of pixels N_(X) having the brightness BR₃ being within apredetermined range [α₁, α₂] with respect to the total number of pixelsN_(T) (i.e., R₁=N_(X)/N_(T)) in the histogram HG is equal to or smallerthan a predetermined threshold value R_(th1) (i.e.,R₁=N_(X)/N_(T)≤R_(th1)).

Specifically, as described above, if there is a change in brightnessbetween the image data ID₁ before machining and the image data ID₂ aftermachining, instead of a decrease in the number of pixels N at thereference value α₀, the number of pixels N is widely distributed in therange of the brightness BR₃ other than the reference value α₀.

Accordingly, if the threshold values α₁ and α₂ of the range [α₁, α₂] areset to include the reference value α₀ as illustrated in FIG. 11, thelarger the change in brightness between the image data ID₁ and the imagedata ID₂ (i.e., the more the number of foreign matters B in FIG. 5 is),the less the number of pixels N_(X) within the range α₁≤BR₃≤α₂ is.Therefore, the rate R₁ of the number of pixels N_(X) with respect to thetotal number of pixels N_(T)(R₁=N_(X)/N_(T)) is data that quantitativelyrepresents a magnitude of the change in brightness between the imagedata ID₁ and the image data ID₂ (i.e., largeness of the number of theforeign matters B included in the image data ID₂ after machining).

The processor 20 calculates the rate R₁ from the data of the histogramHG, and determines that it is necessary to clean the work area 62 (i.e.,determines YES) when the rate R₁ is equal to or less than the thresholdvalue R_(th1), and then proceeds to step S7. On the other hand, theprocessor 20 determines NO when the rate R₁ is larger than the thresholdvalue R_(th1), and proceeds to step S8.

As another example, the processor 20 determines that it is necessary toclean the work area 62 when a rate R₂ of the number of pixels N_(Y)having the brightness BR₃ being out of the range [α₁, α₂] with respectto the total number of pixels N_(T) (i.e., R₂=N_(Y)/N_(T)) in thehistogram HG is equal to or larger than a predetermined threshold valueR_(th2) (i.e., R₂=N_(Y)/N_(T)≥R_(th2)).

In this regard, as the change in brightness between the image data ID₁and the image data ID₂ is larger (i.e., as the number of the foreignmatters B in FIG. 5 increases), the number of pixels N_(X) within therange of α₁≤BR₃≤α₂ decreases, while the number of pixels N_(Y) in therange of BR₃<α₁ or α₂<BR₃ increases. Therefore, the rate R₂ of thenumber of pixels N_(Y) with respect to the total number of pixels N_(T)(R₂=N_(Y)/N_(T)) is data that quantitatively represents the number offoreign matters B included in the image data ID₂ after machining. Theprocessor 20 calculates the rate R₂ from the data of the histogram HG,and determines that it is necessary to clean the work area 62 (YES) whenthe rate R₂ is equal to or larger than the threshold value R_(th2).

As yet another example, the processor 20 extracts a locus of a graphline of the histogram HG (see FIG. 11) acquired in step S5, andcalculates a matching degree between a shape of the locus of the graphline in the histogram HG and a locus of a graph line of a referencehistogram HG_(R). The reference histogram HG_(R) is a histogram in acase where there is no change in brightness between the image data ID₁and the image data ID₂.

The reference histogram HG_(R) may be obtained in the following manner,for example. Specifically, the processor 20 images the image data ID₁twice before machining (step S1). Then, the processor 20 generatesreference image data ID_(R) indicating a degree of change in brightnessbetween two pieces of image data ID₁ imaged before machining, by themethod described in above step S4. Then, the processor 20 acquires thereference histogram HG_(R) from the reference image data ID_(R).

Alternatively, the reference histogram HG_(R) may be manually created bythe operator. The processor 20 determines YES in this step S6 when thematching degree between the shape of the locus of the graph line of thehistogram HG and the shape of the locus of the graph line of thereference histogram HG_(R) is less than a predetermined threshold value.

As yet another example, the processor 20 calculates a standard deviationof the histogram HG acquired in step S5. The processor 20 determines YESin this step S6 when the standard deviation of the histogram HG islarger than a predetermined threshold value. By the method describedabove, the processor 20 determines whether or not to clean the work area62 (e.g., the top surface 60 a) based on the histogram HG. Accordingly,the processor 20 functions as the determination section 30 (FIG. 1)configured to determine whether or not to clean the work area 62.

In step S7, the processor 20 performs cleaning of the work area 62.Specifically, the processor 20 operates the fluid supply device 18 tosupply fluid to the cleaning nozzle 16. The cleaning nozzle 16 injectsthe fluid supplied from the fluid supply tube 26 to the work area 62(the top surface 60 a of the machining table 60) to clean the work area62. After step S7, the processor 20 returns to step S3 and repeatedlyexecutes a loop of steps S3 to S7 until it determines NO in step S6.

Note that the processor 20 may count the number of times “m” for that itexecutes step S7 (or it determines YES in step S6), output an alarmsignal in the form of sound or image indicating that “The number oftimes of cleaning reached predetermined number” when the number of times“m” reaches a predetermined number m_(MAX) (e.g., m_(MAX)=3), andproceed to step S8 (or may end the flow in FIG. 3). Due to this, it ispossible to prevent the number of times of execution of step S7 frombeing too large.

In step S8, the processor 20 analyzes the computer program anddetermines whether or not there is another workpiece to be machined. Theprocessor 20 returns to step S2 when it determines that there is anotherworkpiece to be machined (i.e., determines YES), while the processor 20ends the flow illustrated in FIG. 3 when it determines that there is noworkpiece to be machined (i.e., determines NO).

As described above, in the present embodiment, the imaging device 14images the image data ID₁ and the image data ID₂ before and aftermachining, the image data generation section 28 generates the image dataID₃, and the determination section 30 determines whether or not to cleanthe work area 62 based on the histogram HG. Accordingly, the imagingdevice 14, the image data generation section 28, and the determinationsection 30 constitute a device 70 (FIG. 1) configured to determinewhether or not it is necessary to clean the work area 62 of the machinetool 50.

In the present embodiment, the processor 20 determines whether or not toclean the work area 62 based on the histogram HG that statisticallyindicates the change in brightness between the image data ID₁ and theimage data ID₂ captured before and after machining. According to thisconfiguration, it is possible to determine whether or not it isnecessary to clean the work area 62 with high accuracy, by means of astatistical technique.

Also, in the present embodiment, the processor 20 determines that it isnecessary to clean the work area 62 if the rate R₁ is less than or equalto the threshold value R_(th1) or the rate R₂ is equal to or larger thanthe threshold value R_(th2), in the histogram HG. According to thisconfiguration, it is possible to automatically determine whether or notto clean the work area 62 by a relatively simple algorithm.

Further, in the present embodiment, the processor 20 causes the imagingdevice 14 to image the image data ID₁ after performing the simulationmachining process in step S1. According to this configuration, thearrangement of elements in the work area 62, such as the machining table60, and a state of the machining fluid, which are shown in the imagedata ID₁ and ID₂, can be the same between the image data ID₁ captured instep S1 and the image data ID₂ captured in step S3 after machining.Accordingly, it is possible to prevent the brightness BR₃ of each pixelof the image data ID₃ from including a value due to the arrangement ofelements in the work area 62 and the machining fluid.

Next, a cleaning system 100 according to another embodiment will bedescribed with reference to FIG. 12 and FIG. 13. The cleaning system 100is for cleaning the work area 62 of the machine tool 50, and includesthe imaging device 14, the cleaning nozzle 16, the fluid supply device18, a control device 102, a robot 104, and an attachment device claws.

The control device 102 controls operations of the imaging device 14, thefluid supply device 18, the robot 104, and the attachment device claws.Specifically, the control device 102 is a computer including e.g., aprocessor 108 (CPU, GPU, etc.) and the memory 22 (ROM, RAM, etc.). Theprocessor 108 is communicably connected to the memory 22 via the bus 24,and performs calculations for carrying out various functions to bedescribed below, while communicating with the memory 22.

As illustrated in FIG. 13, in the present embodiment, the robot 104 is avertical articulated robot, and includes a robot base 110, a turningbody 112, a robot arm 114, a wrist 116, and robot hands 118 and 120. Therobot base 110 is fixed on a floor of a work cell. The turning body 112is provided at the robot base 110 so as to be rotatable about a verticalaxis.

The robot arm 114 includes a lower arm 122 rotatably attached to theturning body 112, and an upper arm 124 rotatably attached to a distalend of the lower arm 122. The wrist 116 is provided at a distal end ofthe upper arm 124, and rotatably supports the robot hands 118 and 120.

Servo motors (not illustrated) are provided in the robot base 110, theturning body 112, the robot arm 114, and the wrist 116, respectively.These servo motors drive the turning body 112, the robot arm 114, andthe wrist 116 about their drive shafts under commands from the controldevice 102, thereby operating the robot 104.

The robot hand 118 includes a hand base 128 fixed to an adapter 126provided at a distal end of the wrist 116, and a plurality of fingers130 provided at the hand base 128 so as to open and close. A fingerdriver (not illustrated) having an air cylinder or a motor isincorporated in the hand base 128, and causes the fingers 130 to openand close under a command from the control device 102. As a result, therobot hand 118 grips or releases the cleaning nozzle 16 with its fingers130. Note that the fingers 130 of the robot hand 118 may be configuredto be able to grip a workpiece to be gripped by the robot hand 120, inaddition to the cleaning nozzle 16.

On the other hand, the robot hand 120 includes a hand base 132 fixed tothe adapter 126, and a plurality of fingers 134 provided at the handbase 132 so as to open and close. A second finger driver (notillustrated) having an air cylinder or a motor is incorporated in thehand base 132, and causes the fingers 134 to open and close under acommand from the control device 102. As a result, the robot hand 120grips or releases an object such as a workpiece with its fingers 134.

The attachment device 106 is disposed at a predetermined position in theinterior space A of the machine tool 50, and mounted on the side wall 54b of the splash guard 54. Specifically, as illustrated in FIG. 14, theattachment device 106 includes a base 136 fixed to the side wall 54 b, aplurality of claws 138 provided at the base 136 so as to open and close,and a claw drive section 140 configured to open and close the claws 138.

The claw drive section 140 has an air cylinder or a motor, andautomatically opens and closes the claws 138 under a command from thecontrol device 102. The attachment device 106 can hold the cleaningnozzle 16 between the claws 138 by closing the claws 138, as illustratedin FIG. 15. Further, the attachment device 106 can releases the heldcleaning nozzle 16 by opening the claws 138 as illustrated in FIG. 14.

Note that, in the present embodiment, a flat surface portion 138 a isformed on an inner surface of each claw 138, whereas a flat surfaceportion 16 b that surface-contacts the flat surface portion 138 a isformed on each of both side surfaces of the cleaning nozzle 16. Due tothe surface-contact between the flat surface portion 138 a and the flatsurface portion 16 b, the claws 138 can stably grip the cleaning nozzle16. Note that a high friction portion (a concave-convex portion, arubber layer, a high-friction resin layer, etc.) that increases afriction coefficient between the claws 138 and the cleaning nozzle 16may be provided on the flat surface portion 138 a of each claws 138.

Additionally, the cleaning system 100 may further include a blower (notillustrated) that blows off foreign matter adhered to the inner surfacesof the claws 138 by injecting fluid (e.g., compressed gas) on the innersurfaces. In this case, the blower may be incorporated in the attachmentdevice 106 (e.g., the base 136), and a fluid injection port of theblower may be provided on the inner surfaces (e.g., the flat surfaceportions 138 a) of the claws 138. Due to this, it is possible to preventforeign matter from being adhered to the inner surfaces of the claws138, and thus the attachment device 106 can reliably hold the cleaningnozzle 16 at the same position and orientation.

As illustrated in FIG. 13, the imaging device 14 is fixed to the adapter126 via a bracket 142, and moved to any position and orientation by therobot 104. In the present embodiment, the imaging device 14 is athree-dimensional vision sensor configured to image an object andmeasure a distance to the object.

A robot coordinate system C_(R) is set for the robot 104. The robotcoordinate system C_(R) is a coordinate system that serves as areference for automatic control of each of the movable components (theturning body 112, the robot arm 114, and the wrist 116) of the robot104. In the present embodiment, the robot coordinate system C_(R) is setsuch that its origin is positioned at a center of the robot base 110,and its z-axis coincides with a rotation axis of the turning body 112.The processor 108 generates a command to each servo motor of the robot104 with reference to the robot coordinate system C_(R), and operateseach movable component of the robot 104 so as to arrange the imagingdevice 14 and the robot hands 118 and 120 at any position andorientation in the robot coordinate system C_(R).

The robot base 110 and the turning body 112 of the robot 104 areinstalled outside the splash guard 54 of the machine tool 50. Theprocessor 108 operates the robot 104 so as to advance and retract theimaging device 14 and the robot hands 118 and 120 to and from theinterior space A of the machine tool 50 through the opening 54 cprovided in the side wall 54 b of the splash guard 54.

Next, an operation of the cleaning system 100 will be described withreference to FIG. 16. A flow illustrated in FIG. 16 is started when theprocessor 108 receives a work-start command from an operator, a hostcontroller, or a computer program. At the start of the flow illustratedin FIG. 16, a workpiece is not set on the machining table 60, and thework area 62 of the machine tool 50 is substantially free of foreignmatter. In addition, at the start of the flow illustrated in FIG. 16,the cleaning nozzle 16 is attached to the attachment device 106 (FIG.15).

In step S11, the processor 108 images the work area 62 by the imagingdevice 14. In this embodiment, the processor 108 performs the simulationmachining process before imaging the work area 62. Specifically, theoperator (or the robot 104) sets the jig on the top surface 60 a of themachining table 60. Next, the processor 108 operates the robot 104 togrip a dummy workpiece placed at a predetermined storage place outsidethe machine tool 50 with the robot hand 120, transports the dummyworkpiece to the interior space A of the machine tool 50 through theopening 54 c of the splash guard 54, and then sets the dummy workpieceon the jig. The dummy workpiece has a dimension the same as a workpiece,which is to be machined in step S14 described below and which has beenalready machined.

Then, the processor 108 operates the machining head 56 and the machiningtable 60 in accordance with the machining program. By executing themachining program, the processor 108 causes the machining head 56 andthe machining table 60 to perform the same operation as in the step S14described below, while injecting the machining fluid from the machiningfluid injection device at the same timing and flow rate as in the stepS14 described below. When the machining program is ended, the machininghead 56 and the machining table 60 return to their initial positions.

Then, the processor 108 starts the imaging operation by the imagingdevice 14 at the time t₂ at which the predetermined time τ elapses fromthe time t₁ when the machining fluid has been injected from themachining fluid injection device last time. Specifically, the processor108 operates the robot 104 to dispose the imaging device 14 at apredetermined imaging position. For example, when the imaging device 14is disposed at the imaging position, the imaging device 14 is disposedupward (i.e., in the z-axis positive direction of the robot coordinatesystem C_(R)) of the work area 62, the visual line direction of theimaging device 14 is parallel to the z-axis in the robot coordinatesystem C_(R) (i.e., in the vertical direction), and the bottom wall 54 aof the splash guard 54, the top surface 58 a of the telescopic cover 58,and the top surface 60 a of the machining table 60 of the work area 62fall within the field of view of the imaging device 14.

Position data of the imaging position in the robot coordinate systemC_(R) is pre-stored in the memory 22. When the imaging device 14 isdisposed at the imaging position, the processor 108 operates the imagingdevice 14 to image the work area 62. The imaging device 14 transmits thecaptured image data ID₁ (the first image data) to the processor 108, andthe processor 108 stores the image data ID₁ in the memory 22. This imagedata ID₁ is image data of the work area 62 imaged by the imaging device14 before machining the workpiece in the subsequent step S14. FIG. 17illustrates an example of the image data ID₁ obtained by the imagingdevice 14 imaging the work area 62 in this step S11.

In step S12, the processor 108 operates the imaging device 14 to measurea height h of the work area 62. As described above, the work area 62includes the bottom wall 54 a, the telescopic cover 58, and themachining table 60. As illustrated in FIG. 13, the top surface 58 a ofthe telescopic cover 58 is positioned at a height h₂ upward from theinner surface of the bottom wall 54 a, and the top surface 60 a of themachining table 60 is positioned at a height h₃ (>h₂) upward from thebottom wall 54 a. Thus, the work area 62 includes a zone 54 a (the innersurface of the bottom wall 54 a), a zone 58 a (the top surface 58 a),and a zone 60 a (the top surface 60 a), whose heights h are differentfrom each other.

The imaging device 14 images the image data ID₁ in step S11, andmeasures the height h of each zone (54 a, 58 a, 60 a) of the work area62 included in the image data ID₁. For example, the imaging device 14includes a laser emitting section configured to emit laser beam, and alight receiving section configured to receive the laser light reflectedby an object in the work area 62.

The imaging device 14 measures a distance from the imaging device 14 tothe object in the work area 62 by a triangulation method. Alternatively,the imaging device 14 may have two cameras and measure the distance tothe object in the work area 62 from two images captured by the twocameras. By such a technique, the imaging device 14 can measure adistance d₃ to the zone 60 a, a distance d₂ to the zone 58 a, and adistance d₁ to the zone 54 a, which are present in the work area 62.

These distances d₁, d₂, and d₃ are information indicating the heights hof the zones 54 a, 58 a, and 60 a. Specifically, if the zone 54 a isused as a reference of the height h, the height h₂ of the zone 58 a canbe obtained by subtracting the distance d₂ from the distance d₁, and theheight h₃ of the zone 60 a can be obtained by subtracting the distanced₃ from the distance d₁.

The imaging device 14 may measure the distances d₁, d₂, and d₃ asinformation of the heights h of the zones 54 a, 58 a, and 60 a, or maymeasure the heights h₂ and h₃. The processor 108 acquires theinformation of the heights h measured by the imaging device 14 from theimaging device 14, and stores the information in the memory 22.

In step S13, the processor 108 sets a plurality of image zones inresponse to the heights h of the work area 62, in the image data ID₁imaged by the imaging device 14 in step S11. Specifically, the processor108 extracts from the image data ID₁ each zone in the work area 62 foreach height h, based on the information of the heights h acquired instep S12.

For example, when the distances d₁, d₂, and d₃ are acquired as theinformation of the heights h in step S12, the processor 108 extractsfrom the image data ID₁ the zone where the distance d is within apredetermined range of d_(th1)≤d<d_(th2). For example, assume that thedistance d₃ of the zone 60 a satisfies d_(th1)≤d₃<d_(th2). In this case,the processor 108 extracts an image zone that shows the zone 60 a fromthe image data ID₁, and sets this image zone as an image zone 60 a′ of“height level 3”.

Additionally, the processor 108 extracts a zone where the distance d iswithin a predetermined range of d_(th2)≤d<d_(th3) from the image dataID₁. For example, assume that the distance d₂ of the zone 58 a satisfiesd_(th2)≤d₂<d_(th3). In this case, the processor 108 extracts an imagezone that shows the zone 58 a from the image data ID₁, and sets thisimage zone as an image zone 58 a′ of “height level 2”.

In addition, the processor 108 extracts the zone where the distance d iswithin a predetermined range of d_(th3)≤d from the image data ID₁. Forexample, assume that the distance d₃ of the zone 54 a satisfiesd_(th3)≤d₃. In this case, the processor 108 extracts an image zone thatshows the zone 54 a from the image data ID₁, and sets this image zone asan image zone 54 a′ of “height level 1”.

In FIG. 17, for the sake of easy understanding, the image zone 54 a′(zone 54 a) is indicated by white color, the image zone 58 a′ (zone 58a) is indicated by light gray color, and the image zone 60 a′ (zone 60a) is indicated by dark gray color. The threshold values d_(th1),d_(th2) and d_(th3), which define a range of the distance d describedabove, are predetermined by an operator depending on the imagingposition of the imaging device 14, and stored in the memory 22.

In this way, the processor 108 sets the plurality of image zones 54 a′,58 a′ and 60 a′ in the image data ID₁ in response to the height h of thework area 62, based on the information of the height h acquired in stepS12 (i.e., the distances d). Accordingly, the processor 108 functions asan image zone setting section 144 (FIG. 12) configured to set the imagezones 60 a′, 58 a′ and 54 a′.

Note that, if the heights h₂ and h₃ are acquired as the information ofthe heights h in step S12, the processor 108 can extract each zone inthe work area 62 for each height h from the image data ID₁ by setting apredetermined range for the height h in the same manner as for thedistance d, and can set the image zones 60 a′, 58 a′ and 54 a′,similarly.

In step S14, the processor 108 machines the workpiece. Specifically, theoperator (or the robot 104) attaches the tool 64 to the machining head56, and sets the jig on the top surface 60 a of the machining table 60.The processor 108 then operates the robot 104 so as to grip theworkpiece placed at the predetermined storage place outside the machinetool 50 with the robot hand 120, transports the workpiece to theinterior space A of the machine tool 50 through the opening 54 c of thesplash guard 54, and then sets the workpiece on the jig.

Next, the processor 108 (or the second control device described above)operates the machining head 56 and the machining table 60 in accordancewith the machining program so as to machine the workpiece by the tool 64while injecting the machining fluid from the machining fluid injectiondevice. As a result, foreign matters are deposited in the work area 62of the machine tool 50. When the machining program is ended, themachining head 56 and the machining table 60 return to the same initialposition as at the end of the simulation machining process in step S11.Position data in the robot coordinate system C_(R) of a workpieceposition at which the workpiece is to be placed at the storage place andof a position on the machining table 60 on which the workpiece is to beset is pre-stored in the memory 22.

In step S15, the processor 108 images the work area 62 by the imagingdevice 14. The processor 108 starts this step S15 at the time t₂ whenthe predetermined time τ elapses from the time t₁ at which the machiningfluid has been injected from the machining fluid injection device lasttime in step S14.

Specifically, the processor 108 operates the robot 104 so as to disposethe imaging device 14 at the same imaging position as in step 11, andoperates the imaging device 14 so as to image the work area 62 along thesame visual line direction as in step 11. The imaging device 14transmits the captured image data ID₂ (second image data) to theprocessor 108, and the processor 108 stores the image data ID₂ in thememory 22.

This image data ID₂ is image data of the work area 62 imaged by theimaging device 14 after the workpiece is machined in step S14. FIG. 18illustrates an example of the image data ID₂ obtained by the imagingdevice 14 imaging the work area 62 in this step S15. In the image dataID₂ imaged after machining, the foreign matters B are shown in the workarea 62 (the zones 54 a, 58 a, and 60 a).

In step S16, the processor 108 sets the image zones 54 a′, 58 a′ and 60a′ in the image data ID₂ captured in the most-recent step S15.Specifically, the processor 108 sets the image zones 54 a′, 58 a′ and 60a′ in the image data ID₂ in the same manner as in step S13, based onsetting information of the image zones 54 a′, 58 a′ and 60 a′ set instep S13 (e.g., position data of boundary lines of the image zones 54a′, 58 a′ and 60 a′ in the image data).

As a result, the positions in the image data ID₁ of the image zones 54a′, 58 a′ and 60 a′ set in the image data ID₁ in step S13, and thepositions in the image data ID₂ of the image zones 54 a′, 58 a′ and 60a′ set in the image data ID₂ in this step S16 are the same.

In step S17, the processor 108 determines whether or not it is necessaryto clean the zone 60 a of height level 3. Specifically, the processor108 determines whether or not to clean the zone 60 a, based on imagedata ID_(1_3) of the image zone 60 a′ of height level 3 in the imagedata ID₁ captured in step S11, and on image data ID_(2_3) of the imagezone 60 a′ of height level 3 in the image data ID₂ captured in themost-recent step S15.

Specifically, the processor 108 may compare brightness of each pixel ofthe image data ID_(1_3) before machining with brightness of each pixelof the image data ID_(2_3) after machining, and may detect whether ornot there are the foreign matters in the zone 60 a from a differencebetween them. The processor 108 determines that it is necessary to cleanthe zone 60 a (i.e., determines YES) when the foreign matters in zone 60a are detected in this step S17.

The processor 108 proceeds to step S18 when it determines YES, whereasthe processor 108 proceeds to step S19 when it determines NO. Thus, inthe present embodiment, the processor 108 functions as a determinationsection 146 (FIG. 12) configured to determine whether or not to cleanthe work area 62 (zone 60 a), based on the image data ID₁, ID₂(specifically, the image data ID_(1_3), ID_(2_3)).

In step S18, the processor 108 sets a cleaning-target zone.Specifically, the processor 108 sets the zone 60 a determined to becleaned in step S17 as the cleaning-target zone, along with which, theprocessor 108 also sets the zones 58 a and 54 a, which are lower inheight h than the zone 60 a, as the cleaning-target zone, automatically.As a result, the zones 60 a, 58 a and 54 a are set as thecleaning-target zone. Thus, in the present embodiment, the processor 108functions as a cleaning target zone setting section 148 (FIG. 12).

In step S19, the processor 108 determines whether or not it is necessaryto clean the zone 58 a of height level 2. Specifically, the processor108 determines whether or not to clean the zone 58 a, based on imagedata ID_(1_2) of the image zone 58 a′ of height level 2 in the imagedata ID₁ captured in step S11, and on image data ID_(2_2) of the imagezone 58 a′ of height level 2 in the image data ID₂ captured in themost-recent step S15.

Specifically, the processor 108 may compare brightness of each pixel ofthe image data ID_(1_2) before machining with brightness of each pixelof the image data ID_(2_2) after machining, and may detect whether ornot there are foreign matters in the zone 58 a from a difference betweenthem. The processor 108 determines that it is necessary to clean thezone 58 a (i.e., determines YES) when the foreign matters in the zone 58a are detected in this step S19. The processor 108 proceeds to step S20when it determines YES, whereas the processor 108 proceeds to step S21when it determines NO.

In step S20, the processor 108 sets the cleaning-target zone.Specifically, the processor 108 sets the zone 58 a determined to becleaned in step S19 as the cleaning-target zone, along with which, theprocessor 108 also sets the zone 54 a, which is lower in height h thanthe zone 58 a, as the cleaning-target zone, automatically. Thus, thezones 58 a and 54 a are set as the cleaning-target zone.

In this way, when the processor 108 determines that it is necessary toclean one zone 60 a (or 58 a) in step S17 (or S19), in step S18 (orS20), the processor 108 automatically sets the zones 58 a and 54 a (or54 a) lower in height h than the one zone 60 a (or 58 a) as thecleaning-target zone, together with the one section 60 a (or 58 a).

In step S21, the processor 108 determines whether or not it is necessaryto clean the zone 54 a of height level 1. Specifically, the processor108 determines whether or not to clean the zone 54 a, based on imagedata ID_(1_1) of the image zone 54 a′ of height level 1 in the imagedata ID₁ captured in step S1, and on image data ID_(2_1) of the imagezone 54 a′ of height level 1 in the image data ID₂ captured in themost-recent step S15.

Specifically, the processor 108 may compare brightness of each pixel ofthe image data ID_(1_1) before machining with brightness of each pixelof the image data ID_(2_1) after machining, and detect whether or notthere is foreign matters in the zone 54 a from a difference betweenthem. The processor 108 determines that it is necessary to clean thezone 54 a (i.e., determines YES) when the foreign matters in zone 54 aare detected in this step S21. The processor 108 proceeds to step S22when it determines YES, whereas the processor 108 proceeds to step S24when it determines NO. In step S22, the processor 108 sets the zone 54 adetermined to be cleaned in step S21 as the cleaning-target zone.

In step S23, the processor 108 executes the cleaning operation.Specifically, the processor 108 first carries out a detaching operationto cause the robot 104 to grip the cleaning nozzle 16 attached to theattachment device 106 and detach the cleaning nozzle 16 from theattachment device 106. In this detaching operation, the processor 108operates the robot 104 to move the robot hand 118 (TCP) to a grippingposition for gripping the cleaning nozzle 16 held by the claws 138 ofthe attachment device 106, in a state where the fingers 130 are opened.

When the robot hand 118 is disposed at the gripping position, thecleaning nozzle 16 held by the claws 138 of the attachment device 106 isdisposed between the fingers 130 of the robot hand 118, and the flatsurface portions 16 b of the cleaning nozzle 16 face the inner surfacesof the fingers 130, respectively. Position data of the gripping positionin the robot coordinate system C_(R) is pre-stored in the memory 22.

The processor 108 then closes the fingers 130 to grip the flat surfaceportions 16 b of the cleaning nozzle 16 with the fingers 130. Then, theprocessor 108 drives the claw drive section 140 of the attachment device106 so as to open the claws 138. In this way, the robot 104 detaches thecleaning nozzle 16 from the attachment device 106.

After the detaching operation of the cleaning nozzle 16, the processor108 performs the cleaning operation on the cleaning-target zone set instep S18, S20, or S22. For example, when step S23 is carried out afterstep S18, the processor 108 performs the cleaning operation on the zones60 a, 58 a, and 54 a set as the cleaning-target zone in the descendingorder of height h, i.e., in the order of the zone 60 a, the zone 58 a,and the zone 54 a.

Specifically, the processor 108 operates the fluid supply device 18 soas to inject the fluid from the cleaning nozzle 16 while operating therobot 104 so as to move the cleaning nozzle 16 gripped by the robot hand118 with respect to the zone 60 a, thereby cleaning the entire zone 60 aby the injected fluid. The processor 108 then cleans the entire zone 58a by causing the fluid to be injected from the cleaning nozzle 16 whilemoving the cleaning nozzle 16 with respect to the zone 58 a by the robot104.

The processor 108 then cleans the entire zone 54 a by causing the fluidto be injected from the cleaning nozzle 16 while moving the cleaningnozzle 16 with respect to the zone 54 a by the robot 104. Note that amovement path (or the cleaning position) in which the robot 104 movesthe cleaning nozzle 16 (or TCP) when cleaning each of the zones 60 a, 58a, and 54 a may be defined in the computer program in advance.

On the other hand, when step S23 is carried out after step S20, theprocessor 108 performs the cleaning operation on the zones 58 a and 54 aset as the cleaning-target zone in the descending order of height h,i.e., in the order of the zone 58 a, and the zone 54 a. Also, when stepS23 is carried out after step S22, the processor 108 performs thecleaning operation on the zone 54 a.

In this way, the processor 108 performs the cleaning operation to cleanthe work area 62 by causing the fluid to be injected from the cleaningnozzle 16 while moving the cleaning nozzle 16 with respect to the workarea 62 (zones 60 a, 58 a, and 54 a) by the robot 104. Thus, theprocessor 108 functions as a cleaning execution section 150 (FIG. 12)configured to execute the cleaning operation. After step S23, theprocessor 108 returns to step S15 and repeats a loop of steps S15 to S23until it is determined NO in step S21.

Note that the processor 108 may count the number of times “m” for thatthe processor 108 has performed step S23 (or the number of times forthat it has been determined YES in steps S17, S19, or S21), and when thenumber of times “m” reaches a predetermined number m_(MAX) (e.g.,m_(MAX)=3), the processor 108 may send an alarm signal in the form ofsound or image indicating that “The number of times of cleaning reachedpredetermined number”, and proceed to step S24 (or may end the flow ofFIG. 16). Due to this, it is possible to prevent the number of times ofexecution of step S23 from being too large.

When it is determined NO in step S21, the processor 108 performs anattaching operation to attach the cleaning nozzle 16 to the attachmentdevice. Specifically, the processor 108 operates the robot 104 todispose the robot hand 118 (TCP) gripping the cleaning nozzle 16 at anattaching position. At this time, the claws 138 of the attachment device106 are opened.

When the robot hand 118 is disposed at the attaching position, the flatsurface portions 138 a of the claws 138 of the attachment device 106face the respective flat surface portions 16 b of the cleaning nozzle 16to be gripped by the robot hand 118. Then, the processor 108 drives theclaw drive section 140 of the attachment device 106 so as to close theclaws 138 to grip the cleaning nozzle 16, and subsequently, open thefingers 130 of the robot hand 118. In this way, the processor 108attaches the cleaning nozzle 16 to the attachment device 106 by therobot 104.

In step S24, similarly as in step S8 described above, the processor 108determines whether or not there is another workpiece to be machined. Theprocessor 108 returns to step S14 when it determines YES, and repeats aloop of steps S14 to 24 until it determines NO in step S24. On the otherhand, when the processor 108 determines NO in step S24, it ends the flowillustrated in FIG. 16.

As described above, in the present embodiment, the processor 108 causesthe robot 104 to perform the detaching operation of the cleaning nozzle16 and the cleaning operation on the work area 62. According to thisconfiguration, since the cleaning nozzle 16 can be operated by the robot104 to perform cleaning of the work area 62 of the machine tool 50, itis possible to improve the efficiency of the cleaning operation.

In addition, in the present embodiment, the cleaning nozzle 16 isprovided in the interior space A of the machine tool 50. According tothis configuration, since there is no need to carry the cleaning nozzle16 and the fluid supply tube 26 into and out from the machine tool 50,it is possible to improve the efficiency of the cleaning operation,while preventing the fluid for cleaning from leaking from the cleaningnozzle 16 or the fluid supply tube 26 to the outside of the machine tool50. In addition, piping of the fluid supply tube 26 in the interiorspace A of the machine tool 50 can be simplified.

Further, in this embodiment, when it is determined that it is necessaryto clean one zone 60 a (or 58 a), the processor 108 automatically sets,as the cleaning-target zone (steps S18 and S20), the zones 58 a and 54 a(or 54 a) which are lower in height h than the one zone 60 a (or 58 a),together with the one zone 60 a (or 58 a).

Then, the processor 108 performs the cleaning operation on the zones 60a, 58 a, and 54 a set as the cleaning-target zone, in the descendingorder of height h. According to this configuration, the processor 108can optimize the number of cleaning operations for the work area 62. Inparticular, the foreign matters B, which are blown off when one zone iscleaned by the fluid injected from the cleaning nozzle 16, caneventually accumulate in a zone lower in height than the one zone by theactin of gravity.

Accordingly, if the zone 60 a is cleaned after the zone 58 a, theforeign matters B blown away from the zone 60 a may be deposited in thecleaned zone 58 a. By carrying out the cleaning operation on theplurality of zones 60 a, 58 a, and 54 a in the descending order ofheight h, it is possible to efficiently clean the plurality of zones 60a, 58 a, and 54 a.

Furthermore, in the present embodiment, the robot 104 includes the robothand 118 for gripping the cleaning nozzle and the robot hand 120 forworkpiece loading. Thus, a variety of operations can be performed by thesingle robot 104, and therefore it is possible to improve workefficiency and reduce a manufacturing cost. Note that, in the flowillustrated in FIG. 16, the processor 108 may execute a loop of stepsS15 to S23 every time a total of “n” workpieces are machined (e.g.,n=20).

Note that the above-described device 70 can be applied to the cleaningsystem 100. Below, with reference to FIG. 19, another function of thecleaning system 100 will be described. In the present embodiment, theprocessor 108 functions as the image data generation section 28.Accordingly, the imaging device 14, the image data generation section28, and the determination section 146 constitute the device 70.

Next, another example of the operation of the cleaning system 100 willbe described with reference to FIG. 20. A flow illustrated in FIG. 20differs from the flow illustrated in FIG. 16 in steps S31, S32, and S33.Specifically, after step S16, in step S31, the processor 108 executes acleaning determination scheme for height level 3. This step S31 will bedescribed with reference to FIG. 21.

In step S41, the processor 108 functions as the image data generationsection 28 to generate image data ID_(3_3) (the third image data)indicating a degree of change in brightness between image data ID_(1_3)of the image zone 60 a′ of height level 3 in the image data ID₁ capturedin step S11, and image data ID_(2_3) of the image zone 60 a′ of heightlevel 3 in the image data ID₂ captured in the most-recent step S15.

Specifically, similarly to step S4 described above, the processor 108generates the image data ID_(3_3) having the number of pixels the sameas the image data ID_(1_3) and the image data ID_(2_3), by calculatingthe brightness BR₃ of each pixel of the image data ID_(3_3) usingEquation (1), Equation (2), or Equation (3). The brightness BR₃ of eachpixel of the image data ID_(3_3) is a value corresponding to the degreeof change between the brightness BR₁ of the pixel of the image dataID_(1_3) and the brightness BR₂ of the pixel of the image data ID_(2_3)which corresponds to the pixel of the image data ID_(1_3).

In step S42, the processor 108 acquires a histogram HG₃ of the imagedata ID_(3_3) generated in step S41. The histogram HG₃ is dataindicating a relationship between the brightness BR₃ of each pixel ofthe image data ID_(3_3) and the number of pixels N of the image dataID_(3_3). In step S43, the processor 108 functions as the determinationsection 146 to determine whether or not to clean the zone 60 a of heightlevel 3 based on the histogram HG₃, using the same technique asabove-described step S6.

As an example, similarly to step S6 described above, the processor 108determines that it is necessary to clean the zone 60 a of height level 3(i.e., determines YES) when a rate R_(1_3) of the number of pixelsN_(X_3) having the brightness BR₃ being within a predetermined range[α_(1_3), α_(2_3)] with respect to a total number of pixels N_(T_3)(i.e., R_(1_3)=N_(X_3)/N_(T_3)) in the histogram HG₃ is equal to orsmaller than a predetermined threshold value R_(th1_3). As anotherexample, the processor 108 determines YES when a rate R_(2_3) of thenumber of pixels N_(Y_3) having the brightness BR₃ being out of thepredetermined range [α_(1_3), α_(2_3)] with respect to the total numberof pixels N_(T_3) (i.e., R_(2_3)=N_(Y_3)/N_(T_3)) in the histogram HG₃is equal to or larger than a predetermined threshold value R_(th2_3).

As yet another example, the processor 108 determines YES when a matchingdegree between a locus of a graph line in the histogram HG₃ and a locusof a graph line in a reference histogram HG_(R_3) is smaller than apredetermined threshold value. As yet another example, the processor 108determines YES when a standard deviation of the histogram HG₃ is largerthan a predetermined threshold value. The processor 108 proceeds to stepS18 in FIG. 20 when it determines YES in this step S43, whereas theprocessor 108 proceeds to step 32 in FIG. 20 when it determines NO.

In step S32, the processor 108 executes a cleaning determination schemefor height level 2. This step S32 will be described with reference toFIG. 22. In step S51, the processor 108 functions as the image datageneration section 28 to generate image data ID_(3_2) (third image data)indicating a degree of change in brightness between the image dataID_(1_2) of the image zone 58 a′ of height level 2 in the image data ID₁captured in step S11, and the image data ID_(2_2) of the image zone 58a′ of height level 2 in the image data ID₂ captured in the most-recentstep S15.

Specifically, similarly to above-described step S4, the processor 108generates the image data ID_(3_2) having the number of pixels the sameas the image data ID_(1_2) and the image data ID_(2_2), by calculatingthe brightness BR₃ of each pixel of the image data ID_(3_2), usingEquation (1), Equation (2), or Equation (3). The brightness BR₃ of eachpixel of the image data ID_(3_2) is a value corresponding to the degreeof change between the brightness BR₁ of the pixel of the image dataID_(1_2) and the brightness BR₂ of the pixel of the image data ID_(2_2)which corresponds to the pixel of the image data ID_(1_2).

In step S52, the processor 108 acquires a histogram HG₂ of the imagedata ID_(3_2) generated in step S51. The histogram HG₂ is dataindicating a relationship between the brightness BR₃ of each pixel ofthe image data ID_(3_2) and the number of pixels N of the image dataID_(3_2). In step S53, the processor 108 functions as the determinationsection 146 to determine whether or not to clean the zone 58 a of heightlevel 2, based on the histogram HG₂.

As an example, similarly to step S6 described above, the processor 108determines that it is necessary to clean the zone 58 a of height level 2(i.e., determines YES) when a rate R_(1_2) of the number of pixelsN_(X_2) having the brightness BR₃ being within a predetermined range[α_(1_2), α_(2_2)] with respect to the total number of pixels N_(T_2)(i.e., R_(1_2)=N_(X_2)/N_(T_2)) in the histogram HG₂ is equal to orsmaller than a predetermined threshold value R_(th1_2). As anotherexample, the processor 108 determines YES when a rate R_(2_2) of thenumber of pixels N_(Y_2) having the brightness BR₃ being out of therange [α_(1_2), α_(2_2)] with respect to the total number of pixelsN_(T_2) (i.e., R_(2_2)=N_(Y_2)/N_(T_2)) in the histogram HG₂ is equal toor larger than a predetermined threshold value R_(th2_2).

As yet another example, the processor 108 determines YES when a matchingdegree between a locus of a graph line in the histogram HG₂ and a locusof a graph line of a reference histogram HG_(R_2) is smaller than apredetermined threshold value. As yet another example, the processor 108determines YES when a standard deviation of the histogram HG₂ is largerthan a predetermined threshold value. The processor 108 proceeds to stepS20 in FIG. 20 when determining YES in this step S53, while theprocessor 108 proceeds to step S33 in FIG. 20 when determining NO.

In step S33, the processor 108 executes a cleaning determination schemefor height level 1. This step S33 will be described with reference toFIG. 23. In step S61, the processor 108 functions as the image datageneration section 28 to generate image data ID_(3_1) (third image data)indicating a degree of change in brightness between the image data ID₁of the image zone 54 a′ of height level 1 in the image data ID₁ capturedin step S11, and the image data ID_(2_1) of the image zone 54 a′ ofheight level 1 in the image data ID₂ captured in the most-recent stepS15.

Specifically, similarly to step S4 described above, the processor 108generates the image data ID_(3_1) having the number of pixels the sameas the image data ID_(1_1) and the image data ID_(2_1), by calculatingthe brightness BR₃ of each pixel of the image data ID_(3_1), usingEquation (1), Equation (2), or Equation (3). The brightness BR₃ of eachpixel of the image data ID_(3_1) is a value corresponding to the degreeof change between the brightness BR₁ of the pixel of the image dataID_(1_1) and the brightness BR₂ of the pixel of the image data ID_(2_1)which corresponds to the pixel of the image data ID_(1_1).

In step S62, the processor 108 acquires the histogram HG₁ of the imagedata ID_(3_1) generated in step S61. The histogram HG₁ is dataindicating a relationship between the brightness BR₃ of each pixel ofthe image data ID_(3_1) and the number of pixels N of the image dataID_(3_1). In step S63, the processor 108 functions as the determinationsection 146 to determine whether or not to clean the zone 54 a of heightlevel 1 based on the histogram HG₁.

As an example, similarly to step S6 described above, the processor 108determines that it is necessary to clean the zone 54 a of height level 1(i.e., determines YES) when a rate R_(1_1) of the number of pixelsN_(X_1) having the brightness BR₃ being within a predetermined range[α_(1_1), α_(2_1)] with respect to the total number of pixels N_(T_1)(i.e., R_(1_1)=N_(X_1)/N_(T_1)) in the histogram HG₁ is equal to orsmaller than a predetermined threshold value R_(th1_1). As anotherexample, the processor 108 determines YES when a rate R_(2_1) of thenumber of pixels N_(Y_1) having the brightness BR₃ being out of therange [α_(1_1), α_(2_1)] with respect to the total number of pixelsN_(T_1) (i.e., R_(2_1)=N_(Y_1)/N_(T_1)) in the histogram HG₁ is equal toor larger than a predetermined threshold value R_(th2_1).

As yet another example, the processor 108 determines YES when a matchingdegree between a locus of a graph line of the histogram HG₁ and a locusof a graph line of a reference histogram HG_(R_1) is smaller than apredetermined threshold value. As yet another example, the processor 108determines YES when a standard deviation of the histogram HG₁ is largerthan a predetermined threshold value. The processor 108 proceeds to stepS22 in FIG. 20 when determining YES in this step S63, whereas theprocessor 108 proceeds to step S24 in FIG. 20 when determining NO.

Thus, in the present embodiment, the processor 108 acquires thehistograms HG₃, HG₂, and HG₁ for the respective image zones 60 a′, 58a′, and 54 a′ set in step S16, and determines whether or not to cleanthe zones 60 a, 58 a, and 54 a respectively, based on the acquiredhistograms HG₃, HG₂, and HG₁. According to this configuration, it ispossible to determine whether or not to clean each of the zones 60 a, 58a, and 54 a with high accuracy, by means of a statistical technique.

Note that the cleaning system 100 may include a plurality of cleaningnozzles and a plurality of attachment devices. Such an embodiment isillustrated in FIG. 24. The cleaning system 100′ illustrated in FIG. 24differs from the above-described cleaning system 100 in that thecleaning system 100′ includes a plurality of cleaning nozzles 16A and16B, and a plurality of attachment devices 106A and 106B. The fluidsupply device 18 supplies fluid to the cleaning nozzle 16A through afluid supply tube 26A, and supplies fluid to the cleaning nozzle 16Bthrough a fluid supply tube 26B.

The attachment devices 106A and 106B are provided on the side walls 54 bof the splash guard 54, which face each other in the x-axis direction ofthe robot coordinate system C_(R). The cleaning nozzle 16A is detachablyattached to the attachment device 106 a, while the cleaning nozzle 16Bis detachably attached to the attachment device 106B.

The processor 108 divides the work area 62 into an area 62A on thex-axis negative direction side of the robot coordinate system C_(R), andan area 62B on the x-axis positive direction side of the robotcoordinate system C_(R). The processor 108 causes the robot 104 to gripthe cleaning nozzle 16B and clean the work area 62 by the cleaningnozzle 16B, after (or before) causing the robot 104 to grip the cleaningnozzle 16A and cleaning the area 62A by the cleaning nozzle 16A.

For example, the processor 108 cleans each of the areas 62A and 62B byexecuting the flow illustrated in FIG. 16 or FIG. 20 for each of theareas 62A and 62B. When executing the flow illustrated in FIG. 16 orFIG. 20 for the area 62A, in steps S11 and S15, the processor 108 imagesthe area 62A by the imaging device 14.

On the other hand, when executing the flow illustrated in FIG. 16 orFIG. 20 for the area 62B, in steps S11 and S15, the processor 108 imagesthe area 62B by the imaging device 14. According to the presentembodiment, it is possible to reliably perform the cleaning operation oneach of the areas 62A and 62B of the work area 62, using thecorresponding cleaning nozzles 16A and 16B.

In the cleaning system 100 or 100′ described above, the imaging device14 is a three-dimensional vision sensor capable of measuring a distanceto an object. However, the cleaning system 100 or 100′ may furtherinclude a height measurement instrument for measuring the height h ofthe work area 62, wherein the imaging device 14 may be a camera capableof capturing image data.

In the embodiments described above, the work area 62 includes the zones54 a, 58 a, and 60 a of three height levels. However, it should beunderstood that the work area 62 may include zones of any number ofheight levels. In the embodiments described above, the bottom wall 54 a,the telescopic cover 58, and the machining table 60 are exemplified aselements constituting the zones 54 a, 58 a, and 60 a of different heightlevels. However, the work area 62 may have any element other than thebottom wall 54 a, the telescopic cover 58, and the machining table 60.

The cleaning system 10, 100, or 100′ described above may include aplurality of imaging devices 14A and 14B. For example, the imagingdevice 14A may image a part of the work area 62 (e.g., the area 62Adescribed above), while the imaging device 14B may image the other partof the work area 62 (e.g., the area 62B described above).

Further, a light source for assisting image-capturing (not illustrated)may be provided for increasing light emitted to the work area 62 whenimaging the work area 62 by the imaging device 14, 14A or 14B in theabove-described steps S1, S3, S11, or S15. The light source forassisting image-capturing may be a fluorescent lamp, an LED, or thelike, and may be integrally incorporated in the imaging device 14, 14Aor 14B, or may be provided separate from the imaging device 14, 14A or14B.

In the embodiments described above, the processor 20 performs thesimulation machining process in steps S1 and S11. However, if themachining fluid is not used in the above-described step S2 or S14 forexample, the processor 20 may cause the imaging device 14 to image thework area 62 without performing the simulation machining process in stepS1 or S11.

Further, in the simulation machining process performed in step S1 or S11described above, a dummy workpiece having any shape, with which the tool64 does not contact during the simulation machining process, may beused. Further, in step S1 or S11, after the simulation machining processis performed, the dummy workpiece is removed and then the image of thework area 62 may be captured, and subsequently, in step S3 or S15described above, after the workpiece machined in step S2 or S14 isremoved from the jig and then the image of the work area 62 may becaptured.

When the cleaning system 100 executes the flow illustrated in FIG. 16,the image data ID₁ indicating the state before machining is notnecessarily imaged by the imaging device 14 in step S11, but may becreated by an operator as image data of computer graphics, for example.The robot 104 describe above may be any type of robot, such as ahorizontal articulated robot, and a parallel link robot. Although thepresent disclosure has been described through the above embodiments, theabove embodiments are not intended to limit the claimed invention.

1. A cleaning system configured to clean a work area of a machine tool,the cleaning system comprising: a cleaning nozzle attached to anddetached from an attachment device provided in the machine tool, andconfigured to inject fluid; a robot configured to grip the cleaningnozzle; and a cleaning execution section configured to execute: adetaching operation to operate the robot so as to grip the cleaningnozzle attached to the attachment device and detach the cleaning nozzlefrom the attachment device; and a cleaning operation to move thecleaning nozzle with respect to the work area by the robot, and injectthe fluid from the cleaning nozzle to clean the work area.
 2. Thecleaning system of claim 1, wherein the attachment device is provided inan interior of the machine tool, wherein the robot is provided outsidethe machine tool so as to advance into and retract from the interior ofthe machine tool through an opening provided in the machine tool.
 3. Thecleaning system of claim 1, further comprising: an imaging deviceconfigured to image the working area; and a determination sectionconfigured to determine whether or not to clean the work area based onimage data of the work area imaged by the imaging device.
 4. Thecleaning system of claim 3, wherein the work area includes a pluralityof zones whose heights are different from each other, wherein thedetermination section determines whether or not to clean each zone basedon the image data imaged by the imaging device, wherein the cleaningsystem further comprising a cleaning target zone setting sectionconfigured to, when the determination section determines that it isnecessary to clean one zone, automatically set, as a cleaning-targetzone, the other zone, whose height is lower than the one zone, togetherwith the one zone.
 5. The cleaning system of claim 4, wherein thecleaning execution section executes the cleaning operation on the zones,which are set as the cleaning-target zone by the cleaning target zonesetting section, in a descending order of their heights.
 6. The cleaningsystem of claim 3, wherein the work area includes a plurality of zoneswhose heights are different from each other, wherein the cleaning systemfurther comprising an image zone setting section configured to set aplurality of image zones in the image data imaged by the imaging device,in response to the heights, wherein the determination section determineswhether or not to clean each zone, based on the image data of each imagezone set by the image zone setting section.
 7. The cleaning system ofclaim 6, wherein the imaging device is configured to measure the heightsalong with capturing the image data, wherein the image zone settingsection sets the plurality of image zones in the image data, based oninformation of the heights measured by the imaging device.
 8. A methodof cleaning a work area of a machine tool, comprising executing: adetaching operation to operate a robot so as to grip a cleaning nozzleattached to an attachment device provided in the machine tool and detachthe cleaning nozzle from the attachment device; and a cleaning operationto move the cleaning nozzle with respect to the work area by the robot,and inject fluid from the cleaning nozzle to clean the work area.